#! /bin/bash

readonly unit_file_dir=$(dirname $(realpath $0))/systemd;
readonly dev_env_dir=$(dirname $(dirname $(dirname $unit_file_dir)));

${dev_env_dir}/py exec apt/ensure nfs-common;

readonly unit_file_path=$unit_file_dir/mnt-nas.mount;
readonly unit_file_link_path=/etc/systemd/system/mnt-nas.mount;

if [ -e $unit_file_link_path ]
then
  sudo rm $unit_file_link_path;
fi

sudo ln -sf $unit_file_path $unit_file_link_path

sudo systemctl daemon-reload
sudo systemctl restart mnt-nas.mount
sudo systemctl enable mnt-nas.mount

